import { ref } from 'vue'

export function useEduDegree() {
	const pickerRef = ref<any>(null)
	const columns = ref(['初中', '高中', '大专', '本科', '其他'])
	const show = ref(false)

	const open = (value: string) => {
		let pickerIndex = 0

		if (value) {
			pickerIndex = columns.value.indexOf(value)
		}

		pickerRef.value.setIndexs([pickerIndex])

		show.value = true
	}

	const close = () => {
		show.value = false
	}

	return {
		pickerRef,
		columns,
		show,
		open,
		close,
	}
}
